import { FilterItem } from "@/components/FilterBar/types";
import { ref } from "vue";

export interface filterType {
  eventLevel?: string;
  terminal?: string;
  eventTypeId?: string[];
  eventTime?: string[];
  createTime?: string[];
  processGroup?: { id: string; name: string }[];
  creatorName?: string;
  status?: string;
  eventOccurStartTime?: string;
  eventOccurEndTime?: string;
  reportStartTime?: string;
  reportEndTime?: string;
}

export interface itemType {
  label: string;
  value: string;
}

export const filterOptions = ref<Array<FilterItem>>([
  {
    label: "事件级别",
    prop: "eventLevel",
    type: "select",
    defaultValue: "",
    span: 8,
    filterable: true,
    inputProps: {
      clearable: true,
      placeholder: "请选择事件级别",
      options: [],
    },
  },

  {
    label: "航站楼",
    prop: "terminal",
    type: "checkbox",
    defaultValue: [],
    span: 8,
    inputProps: {
      options: [],
    },
  },
  {
    label: "事件类型",
    prop: "eventTypeId",
    type: "select",
    multiple: true,
    defaultValue: [],
    span: 8,
    filterable: true,
    inputProps: {
      clearable: true,
      placeholder: "请选择事件类型",
      options: [],
    },
  },
  {
    label: "发生时间",
    prop: "eventTime",
    type: "datePicker",
    defaultValue: [],
    span: 8,
    inputProps: {
      placeholder: "请选择发生时间",
      type: "datetimerange",
      "value-format": "YYYY-MM-DD HH:mm:ss",
      defaultTime: [
        new Date(2000, 1, 1, 0, 0, 0),
        new Date(2000, 2, 1, 23, 59, 59),
      ],
    },
  },
  {
    label: "上报时间",
    prop: "createTime",
    type: "datePicker",
    span: 8,
    defaultValue: [],
    inputProps: {
      placeholder: "请选择上报时间",
      type: "datetimerange",
      "value-format": "YYYY-MM-DD HH:mm:ss",
      defaultTime: [
        new Date(2000, 1, 1, 0, 0, 0),
        new Date(2000, 2, 1, 23, 59, 59),
      ],
    },
  },
  {
    label: "区域处置单位",
    prop: "processGroupId",
    type: "treeSelect",
    defaultValue: "",
    span: 8,
    filterable: true,
    inputProps: {
      clearable: true,
      "default-expand-all": true,
      // 'show-checkbox': true,
      "check-strictly": true,
      "node-key": "organizationId",
      defaultProps: {
        label: "organizationName",
      },
      data: [],
    },
  },
  {
    label: "上报人",
    prop: "creatorName",
    type: "select",
    defaultValue: [],
    span: 8,
    filterable: true,
    inputProps: {
      clearable: true,
      placeholder: "请选择上报人",
      options: [],
    },
  },
  {
    label: "状态",
    prop: "status",
    type: "select",
    defaultValue: "",
    span: 8,
    filterable: true,
    inputProps: {
      clearable: true,
      placeholder: "请选择状态",
      options: [],
    },
  },
]);
